﻿<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8" />
    <title>刑罚科监控会议进度</title>
    <link href="/WF/Scripts/bootstrap/css/bootstrap.css" rel="stylesheet" type="text/css" />
    <link href="/WF/Scripts/bootstrap/css/font-awesome.css" rel="stylesheet">
    <link href="/WF/Style/skin/css/style.css" rel="stylesheet" type="text/css" />
    <link href="/WF/Style/skin/css/animate.css" rel="stylesheet" type="text/css" />
    <link href="/WF/Style/skin/font/iconfont.css" rel="stylesheet" type="text/css" />
    <!--通用js-->
    <script src="/WF/Scripts/jquery-1.11.0.min.js" type="text/javascript"></script>
    <script src="/WF/Scripts/QueryString.js" type="text/javascript"></script>
    <script src="/WF/Scripts/config.js" type="text/javascript"></script>
    <script src="/WF/Comm/Gener.js" type="text/javascript"></script>
    <link href="css/icons.css" rel="stylesheet" />
    <style type="text/css">
    </style>
    <script type="text/javascript">
        var workID = GetQueryString("WorkID"); // workid 子线程的ID.
        $(function () {

            var html = "<table class='table table-bordered table - hover' >";

            var webUser = new WebUser();

            html += "<caption>您好：" + webUser.No + webUser.Name + " 来自：" + webUser.FK_DeptName + "</caption>";
            html += "<tr>";
            html += "  <th>" + webUser.FK_Dept + webUser.FK_DeptName + "</th>";
            html += "  <th>编号</th>";
            html += "  <th>名称</th>";
            html += "  <th>状态</th>";
            html += "</tr>";

            var no = webUser.FK_Dept.slice(0, 4);
            //   var no = webUser.FK_Dept.slice(0, 4);

            //监区.
            var jianqus = new Entities("BP.JianYu.JianQus");
            jianqus.Retrieve("PrisonNo", no);
            //  jianqus.RetrieveAll();
            console.log(jianqus);

            //分监区监狱.
            var fenJianQus = new Entities("BP.JianYu.FenJianQus");
            fenJianQus.Retrieve("PrisonNo", no);
            console.log(fenJianQus);

            for (var i = 0; i < jianqus.length; i++) {
                var jianqu = jianqus[i];

                html += "<tr>";
                html += "  <th>" + i + "</th>";
                html += "  <th>" + jianqu.No + "</th>";
                html += "  <th>" + jianqu.Name + "</th>";
                html += "  <th>状态</th>";
                html += "</tr>";

                //  var fenJianQus = new Entities("BP.JianYu.FenJianQus");
                // fenJianQus.Retrieve("JianQuNo", jianqu.No);

                //
                for (var myidx = 0; myidx < fenJianQus.length; myidx++) {
                    var fenJianQu = fenJianQus[myidx];

                    if (fenJianQu.JianQuNo != jianqu.No)
                        continue;

                    html += "<tr>";
                    html += "  <td>" + i + "</td>";
                    html += "  <td>" + fenJianQu.No + "</td>";
                    html += "  <td>" + fenJianQu.Name + "</td>";
                    html += "  <td>状态</td>";
                    html += "</tr>";
                }
            }

            html += "</table>";
            $("#docs1").html(html);

        });

        //执行发送到下一步.
        function SendIt() {

            if (window.confirm('确定要发送吗？') == false)
                return;

            $("#toolbar").html("正在发送请稍后.");

            var handler = new HttpHandler("BP.JianYu.AppHandler");
            handler.AddUrlData();
            var data = handler.DoMethodReturnString("ND102_SendIt");
            $("#docs").html(data);
        }
        function Subthread() {
            var url = "/WF/WorkOpt/ThreadDtl.htm?WorkID=" + GetQueryString("WorkID");

            WinOpen(url);
        }
        function Chart() {
            var url = "/WF/WorkOpt/OneWork/Chart.htm?WorkID=" + GetQueryString("WorkID") + "&FK_Node=" + GetQueryString("FK_Node");
            url += "&FID=" + GetQueryString("FID") + "&FK_Flow=001";
            WinOpen(url);
        }
    </script>
</head>
<body>
    <form>

        <div id="toolbar">
            <h3>
                刑罚科：监控会议进度
                <a href="javascript:SendIt();"> 发送给 刑罚科 流程 </a>
            </h3>
        </div>

            <div id="docs1">
            </div>
        <!--<fieldset>
            <legend>监区进度</legend>
            <div id="docs2">
            </div>
        </fieldset>-->

    </form>

</body>
</html>
